// Copyright 2009 StarCite Inc.  All rights reserved.
// ListLocalFilesServlet.java 6:37:49 PM danny.liu
package com.billowsoft.syncer.servlet;

import java.io.IOException;
import java.util.Arrays;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.billowsoft.syncer.model.SyncDirectory;

/**
 * @author danny.liu Nov 24, 2011
 * @version 1.0
 * 
 */
public class ListLocalFilesServlet extends HttpServlet {

	private static final long serialVersionUID = 4414123685312028154L;
	
	public final static List<String> baseDirs = Arrays.asList("C:\\Users\\danny.liu\\Desktop", "D:\\");

	public static final String serverDir = "\\\\shfile01\\Backup\\danny.liu";
	
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		String subDir = req.getParameter("subDir");
		if(subDir != null){
			SyncDirectory directory = new SyncDirectory(subDir);
			req.setAttribute("syncDirectory", directory);
		}

		this.getServletContext().getRequestDispatcher("/listLocalFiles.jsp").forward(req, resp);
	}


}
